package com.rayboo.example.design.pattern.builder;

/**
 * 建造者模式
 * http://c.biancheng.net/view/1354.html
 */
public class Main {

    public static void main(String[] args) {
        Computer.Builder builder = Computer.newBuilder();
        builder.setMainboard("华硕主板");
        builder.setDisplayer("三星显示器");
        builder.setKeyboard("罗技键盘");
        builder.setMouse("罗技鼠标");
        Computer computer1 = builder.build();
        System.out.println("第一台电脑：" + computer1);

        Computer computer2 = Computer.newBuilder()
                .setMainboard("联想主板")
                .setDisplayer("戴尔显示器")
                .build();
        System.out.println("第二台电脑：" + computer2);
    }
}
